' Sample declarations for Vaunix Frequency synthesizer DLL
' VB6 style

' Useful constants -- status values that can be returned

Const STATUS_OK As Long = 0
Const BAD_PARAMETER As Long = &H80010000
Const BAD_HID_IO As Long = &H80020000
Const DEVICE_NOT_READY As Long = &H80030000

Const INVALID_DEVID As Long = &H80000000
Const DEV_CONNECTED As Long = &H00000001
Const DEV_OPENED As Long = &H00000002
Const SWP_ACTIVE As Long = &H00000004
Const SWP_UP As Long = &H00000008
Const SWP_REPEAT As Long = &H00000010


' void fnLSG_SetTestMode(bool testmode);
Declare Sub fnLSG_SetTestMode Lib "vnx_fsynsth.dll" Alias "_fnLSG_SetTestMode@4" ( ByVal testmode As Long)

' int fnLSG_GetNumDevices();
Declare Function fnLSG_GetNumDevices Lib "vnx_fsynsth.dll" Alias "_fnLSG_GetNumDevices@0" ( ) As Long

' int fnLSG_GetDevInfo(DEVID *ActiveDevices);
Declare Function fnLSG_GetDevInfo Lib "vnx_fsynsth.dll" Alias "_fnLSG_GetDevInfo@4" ( ActiveDevicesFirstElement As Long) As Long
	
' int fnLSG_GetDeviceStatus(DEVID deviceID);	
Declare Function fnLSG_GetDeviceStatus Lib "vnx_fsynsth.dll" Alias "_fnLSG_GetDeviceStatus@4" ( ByVal deviceID As Long) As Long

' int fnLSG_GetModelName(DEVID deviceID, char *ModelName);
Declare Function fnLSG_GetModelName Lib "vnx_fsynsth.dll" Alias "_fnLSG_GetModelName@8" ( ByVal deviceID As Long, ByVal modelname As String) As Long

' int fnLSG_InitDevice(DEVID deviceID);
Declare Function fnLSG_InitDevice Lib "vnx_fsynsth.dll" Alias "_fnLSG_InitDevice@4" ( ByVal deviceID As Long) As Long

' int fnLSG_CloseDevice(DEVID deviceID);
Declare Function fnLSG_CloseDevice Lib "vnx_fsynsth.dll" Alias "_fnLSG_CloseDevice@4" ( ByVal deviceID As Long) As Long

' int fnLSG_GetSerialNumber(DEVID deviceID);
Declare Function fnLSG_GetSerialNumber Lib "vnx_fsynsth.dll" Alias "_fnLSG_GetSerialNumber@4" ( ByVal deviceID As Long) As Long

' int fnLSG_SetFrequency(DEVID deviceID, int attenuation);
Declare Function fnLSG_SetFrequency Lib "vnx_fsynsth.dll" Alias "_fnLSG_SetFrequency@8" ( ByVal deviceID As Long, ByVal frequency As Long) As Long

' int fnLSG_SetStartFrequency(DEVID deviceID, int startfrequency);
Declare Function fnLSG_SetStartFrequency Lib "vnx_fsynsth.dll" Alias "_fnLSG_SetStartFrequency@8" ( ByVal deviceID As Long, ByVal startfrequency As Long) As Long

' int fnLSG_SetEndFrequency(DEVID deviceID, int endfrequency);
Declare Function fnLSG_SetEndFrequency Lib "vnx_fsynsth.dll" Alias "_fnLSG_SetEndFrequency@8" ( ByVal deviceID As Long, ByVal endfrequency As Long) As Long
	
' int fnLSG_SetFrequencyStep(DEVID deviceID, int frequencystep);
Declare Function fnLSG_SetFrequencyStep Lib "vnx_fsynsth.dll" Alias "_fnLSG_SetFrequencyStep@8" ( ByVal deviceID As Long, ByVal frequencystep As Long) As Long
	
' int fnLSG_SetDwellTime(DEVID deviceID, int dwelltime);
Declare Function fnLSG_SetDwellTime Lib "vnx_fsynsth.dll" Alias "_fnLSG_SetDwellTime@8" ( ByVal deviceID As Long, ByVal dwelltime As Long) As Long
	
' int fnLSG_SetPowerLevel(DEVID deviceID, int powerlevel);
Declare Function fnLSG_SetPowerLevel Lib "vnx_fsynsth.dll" Alias "_fnLSG_SetPowerLevel@8" ( ByVal deviceID As Long, ByVal powerlevel As Long) As Long
	
' int fnLSG_SetRFOn(DEVID deviceID, bool on);
Declare Function fnLSG_SetRFOn Lib "vnx_fsynsth.dll" Alias "_fnLSG_SetRFOn@8" ( ByVal deviceID As Long, ByVal rf_on As Long) As Long
	
' int fnLSG_SetSweepDirection(DEVID deviceID, bool up);
Declare Function fnLSG_SetSweepDirection Lib "vnx_fsynsth.dll" Alias "_fnLSG_SetSweepDirection@8" ( ByVal deviceID As Long, ByVal ramp_up As Long) As Long

' int fnLSG_SetSweepMode(DEVID deviceID, bool mode);
Declare Function fnLSG_SetSweepMode Lib "vnx_fsynsth.dll" Alias "_fnLSG_SetSweepMode@8" ( ByVal deviceID As Long, ByVal ramp_mode As Long) As Long

' int fnLSG_StartSweep(DEVID deviceID, bool go);
Declare Function fnLSG_StartSweep Lib "vnx_fsynsth.dll" Alias "_fnLSG_StartSweep@8" ( ByVal deviceID As Long, ByVal start_sweep As Long) As Long

' int fnLSG_SetUseInternalRef(DEVID deviceID, bool internal);
Declare Function fnLSG_SetUseInternalRef Lib "vnx_fsynsth.dll" Alias "_fnLSG_SetUseInternalRef@8" ( ByVal deviceID As Long, ByVal internal As Long) As Long

' int fnLSG_SaveSettings(DEVID deviceID);
Declare Function fnLSG_SaveSettings Lib "vnx_fsynsth.dll" Alias "_fnLSG_SaveSettings@4" ( ByVal deviceID As Long) As Long

' int fnLSG_GetFrequency(DEVID deviceID);
Declare Function fnLSG_GetFrequency Lib "vnx_fsynsth.dll" Alias "_fnLSG_GetFrequency@4" ( ByVal deviceID As Long) As Long
	
' int fnLSG_GetStartFrequency(DEVID deviceID);
Declare Function fnLSG_GetStartFrequency Lib "vnx_fsynsth.dll" Alias "_fnLSG_GetStartFrequency@4" ( ByVal deviceID As Long) As Long
	
' int fnLSG_GetEndFrequency(DEVID deviceID);
Declare Function fnLSG_GetEndFrequency Lib "vnx_fsynsth.dll" Alias "_fnLSG_GetEndFrequency@4" ( ByVal deviceID As Long) As Long
	
' int fnLSG_GetDwellTime(DEVID deviceID);
Declare Function fnLSG_GetDwellTime Lib "vnx_fsynsth.dll" Alias "_fnLSG_GetDwellTime@4" ( ByVal deviceID As Long) As Long
	
' int fnLSG_GetFrequencyStep(DEVID deviceID);
Declare Function fnLSG_GetFrequencyStep Lib "vnx_fsynsth.dll" Alias "_GetFrequencyStep@4" ( ByVal deviceID As Long) As Long
	
' int fnLSG_GetRF_On(DEVID deviceID);
Declare Function fnLSG_GetRF_On Lib "vnx_fsynsth.dll" Alias "_fnLSG_GetRF_On@4" ( ByVal deviceID As Long) As Long

' int fnLSG_GetUseInternalRef(DEVID deviceID);
Declare Function fnLSG_GetUseInternalRef Lib "vnx_fsynsth.dll" Alias "_fnLSG_GetUseInternalRef@4" ( ByVal deviceID As Long) As Long

' int fnLSG_GetMaxFreq(DEVID deviceID);
Declare Function fnLSG_GetMaxFreq Lib "vnx_fsynsth.dll" Alias "_fnLSG_GetMaxFreq@4" ( ByVal deviceID As Long) As Long
	
' int fnLSG_GetMinFreq(DEVID deviceID);
Declare Function fnLSG_GetMinFreq Lib "vnx_fsynsth.dll" Alias "_fnLSG_GetMinFreq@4" ( ByVal deviceID As Long) As Long

' int fnLSG_GetMinPwr(DEVID deviceID);
Declare Function fnLSG_GetMinPwr Lib "vnx_fsynsth.dll" Alias "_fnLSG_GetMinPwr@4" ( ByVal deviceID As Long) As Long

' int fnLSG_GetMaxPwr(DEVID deviceID);
Declare Function fnLSG_GetMaxPwr Lib "vnx_fsynsth.dll" Alias "_fnLSG_GetMaxPwr@4" ( ByVal deviceID As Long) As Long

' int fnLSG_GetPowerLevel(DEVID deviceID);
Declare Function fnLSG_GetPowerLevel Lib "vnx_fsynsth.dll" Alias "_fnLSG_GetPowerLevel@4" ( ByVal deviceID As Long) As Long